<template>
    <a-dropdown>
        <a class="ant-dropdown-link" @click="e => e.preventDefault()">
            <a-icon type="global" />
        </a>
        <a-menu slot="overlay">
            <a-menu-item>
                <a href="javascript:;" @click="changeLanguage('cn')">CN 简体中文</a>
            </a-menu-item>
            <a-menu-item>
                <a href="javascript:;" @click="changeLanguage('cn')">HK 繁体中文</a>
            </a-menu-item>
            <a-menu-item>
                <a href="javascript:;" @click="changeLanguage('us')">US ENGLISH</a>
            </a-menu-item>
            <a-menu-item>
                <a href="javascript:;" @click="changeLanguage('us')">BR Português</a>
            </a-menu-item>
        </a-menu>
    </a-dropdown>
</template>


<script>
    export default {
        name: "languageComponent",
        data() {
            return {};
        },
        methods: {
            changeLanguage(value) {
                localStorage.setItem("language", value);
                this.$i18n.locale = value;
            },
        },
        mounted() { },
    };
</script>

<style scoped>
    .anticon {
        font-size: 18px;
        cursor: pointer;
        color: #666;
    }
</style>